Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ansi-escapes

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-escapes

ANSI escape codes for manipulating the terminal

  • 4.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50M
decreased by-3.98%
Maintainers
1
Weekly downloads
 
Created

What is ansi-escapes?

The ansi-escapes npm package provides a collection of ANSI escape codes for manipulating the terminal. These codes can be used to control cursor movement, erase text, manage scrollback, and more, allowing developers to create interactive command-line applications.

What are ansi-escapes's main functionalities?

Cursor Movement

Moves the cursor to the specified x and y position (column 5, row 10).

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.cursorTo(5, 10));

Erase Lines

Erases the specified number of lines (2 lines in this case) from the current cursor position up.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.eraseLines(2));

Scrolling

Scrolls the terminal viewport up or down one line.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.scrollUp());
console.log(ansiEscapes.scrollDown());

Clearing Screen

Clears the terminal screen and moves the cursor to the upper-left corner.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.clearScreen);

Beep

Triggers the terminal bell, which often makes an audible beep sound.

const ansiEscapes = require('ansi-escapes');
console.log(ansiEscapes.beep);

Other packages similar to ansi-escapes

Keywords

FAQs

Package last updated on 24 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc